package com.lagou.pojo;

public class MappedStatement {

    //id标识
    private String id;
    //返回值类型
    private String resultType;
    //参数值类型
    private String paramterType;
    //sql语句
    private String sql;

    private SqlCommandType sqlCommandType;

    public MappedStatement() {
    }

    private MappedStatement(Builder builder) {
        setId(builder.id);
        setResultType(builder.resultType);
        setParamterType(builder.paramterType);
        setSql(builder.sql);
        setSqlCommandType(builder.sqlCommandType);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getResultType() {
        return resultType;
    }

    public void setResultType(String resultType) {
        this.resultType = resultType;
    }

    public String getParamterType() {
        return paramterType;
    }

    public void setParamterType(String paramterType) {
        this.paramterType = paramterType;
    }

    public String getSql() {
        return sql;
    }

    public void setSql(String sql) {
        this.sql = sql;
    }

    public SqlCommandType getSqlCommandType() {
        return sqlCommandType;
    }

    public void setSqlCommandType(SqlCommandType sqlCommandType) {
        this.sqlCommandType = sqlCommandType;
    }


    public static final class Builder {
        private String id;
        private String resultType;
        private String paramterType;
        private String sql;
        private SqlCommandType sqlCommandType;

        public Builder() {
        }

        public Builder id(String val) {
            id = val;
            return this;
        }

        public Builder resultType(String val) {
            resultType = val;
            return this;
        }

        public Builder paramterType(String val) {
            paramterType = val;
            return this;
        }

        public Builder sql(String val) {
            sql = val;
            return this;
        }

        public Builder sqlCommandType(SqlCommandType val) {
            sqlCommandType = val;
            return this;
        }

        public MappedStatement build() {
            return new MappedStatement(this);
        }
    }
}
